Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
WalkthroughThe workflow file is restructured to separate formatting validation from automatic fixes. A new prettier-check job validates formatting on pull requests, while the existing prettier-fix job applies and commits formatting changes on pushes. The workflow is renamed to "Formatting," permissions are set to read-only at the top level with explicit write permissions for the fix job, and Node.js v24 is configured for both operations. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/prettier-fix.yml:
- Around line 29-33: Add prettier to mcpjam-inspector's devDependencies in
package.json so the CI fix job can run the repo-pinned formatter; update
package.json's "devDependencies" to include "prettier" (matching the version
used by the workflow or desired pinned version) so the existing npm script that
runs "prettier --write ." (invoked by the "npm run prettier-fix" job) succeeds
after npm ci installs packages.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 077f6366-4b92-4fd3-8ba2-c62f63edf532
📒 Files selected for processing (1)
.github/workflows/prettier-fix.yml
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Check formatting | ||
| run: npx prettier --check . |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
pkg="mcpjam-inspector/package.json"
echo "== scripts.prettier-fix =="
jq -r '.scripts["prettier-fix"] // "MISSING"' "$pkg"
echo
echo "== declared prettier dependency =="
jq -r '.devDependencies.prettier // .dependencies.prettier // "MISSING"' "$pkg"Repository: MCPJam/inspector
Length of output: 149
🏁 Script executed:
cat -n .github/workflows/prettier-fix.ymlRepository: MCPJam/inspector
Length of output: 1942
Add prettier to mcpjam-inspector/package.json devDependencies.
The workflow uses npx prettier in the check job (line 33), which downloads prettier dynamically and works. However, the fix job (line 61) runs npm run prettier-fix, which invokes the script prettier --write .. This will fail because npm ci installed dependencies from an incomplete package.json that doesn't declare prettier. Add prettier as a dev dependency to ensure both jobs use the same repo-pinned formatter version.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/prettier-fix.yml around lines 29 - 33, Add prettier to
mcpjam-inspector's devDependencies in package.json so the CI fix job can run the
repo-pinned formatter; update package.json's "devDependencies" to include
"prettier" (matching the version used by the workflow or desired pinned version)
so the existing npm script that runs "prettier --write ." (invoked by the "npm
run prettier-fix" job) succeeds after npm ci installs packages.
Summary
Check Code Formattingso it matches the required branch-protection contextmainso PR workflows stop pushing a new head SHA that never gets follow-on checksmainwhile making PR formatting purely a checkTesting